<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\BasePageRequest;
use App\Library\Requests\Base\IdRequest;
use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Service\CollectService;
use Illuminate\Http\JsonResponse;

class CollectController extends BaseController
{
    /**
     * @param CollectService $service
     */
    public function __construct(CollectService $service)
    {
        $this->service = $service;
    }

    /**
     * 分页
     * @param BasePageRequest $request
     * @return JsonResponse
     */
    public function paging(BasePageRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     * 添加
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function add(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }

    /**
     * delete
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function delete(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->delete($request);
    }

    /**
     * detail
     * @param IdRequest $request
     * @return JsonResponse
     */
    public function detail(IdRequest $request): JsonResponse
    {
        return $this->service->detail($request);
    }
}
